package com.qf.anno;

import com.qf.xml.service.ComplexObject;
import com.qf.xml.service.ComplexObject2;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class MyFactory {

    @Bean //相当于是xml中的factory-bean配置方式
    public ComplexObject getBean(){
        return new ComplexObject();
    }

    @Bean //可以通过@Bean注解中的value属性，给这个Bean名命，如果不配置，那么这个Bean的名字是方法名
    public static ComplexObject2 getBean2(){
        return new ComplexObject2();
    }
}
